import request from '@/utils/request'

// RESTful风格博客API
export const blogApi = {
  // 获取博客列表
  getBlogs: (params) => request({ url: '/blog-admin/content/posts', method: 'get', params }),
  
  // 获取单篇博客
  getBlog: (id) => request({ url: `/blog-admin/content/posts/${id}`, method: 'get' }),
  
  // 创建博客
  createBlog: (data) => request({ url: '/blog-admin/content/posts', method: 'post', data }),
  
  // 更新博客
  updateBlog: (id, data) => request({ url: `/blog-admin/content/posts/${id}`, method: 'put', data }),
  
  // 删除博客
  deleteBlog: (id) => request({ url: `/blog-admin/content/posts/${id}`, method: 'delete' }),
}